<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>申请退款</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link href="./static/css/base.css" rel="stylesheet">
    <script src="./static/js/jquery.min.1.10.2.js" type="text/javascript" charset="utf-8"></script>
</head>

<body>
    <section class="main">
        <section class="top"></section>
        <section class="requestRefund">
            <div class="reason"><span>请选择退款原因</span><span class="reason_txt">生意不好</span><img src="./static/images/righrG.png"></div>
            <div class="top"></div>
            <div class="explanation">退款说明：如果后期不再使用的话可以申请退款，前三个月后会有1200元/月的折旧费。超过三个月后不再收。</div>
        </section>
        <section class="confirm">确认申请</section>
        <section class="prompt">您已经开通2个月了，折旧费：2400元，可退款2480元</section>
    </section>
    <script type="text/javascript" charset="utf-8" async defer>
    (function() {
        var frame = function() {
            var pane = $.extend(true, {}, Pane)
            var api = $.extend(true, {}, API)
            var model = $.extend(true, {}, Model)
            pane.api = api
            pane.model = model
            pane.init()
        }
        var Pane = {
            init() {
                this.domflag = false;
                this.initbody();
                this.bindEvents();
            },
            initbody() {
                // let data = this.api.getList();
                let that = this;
            },
            bindEvents() {
                $(".main")
                    .on('click', '.reason img,.reason_txt', ({ currentTarget, target }) => {
                        let dom = `<section class="bottom">
                                        <section class="reason_options">
                                            <div class="options">
                                                <div>生意不好</div>
                                                <div>产品质量问题</div>
                                                <div>七天无理由退货</div>
                                                <div>退款原因</div>
                                                <div>其他</div>
                                            </div>
                                            <div class="top"></div>
                                            <div class="cancel">取消</div>
                                        </section>
                                    </section>`
                        $(".main").append(dom);
                    })
                    .on('click', '.options div', ({ currentTarget, target }) => {
                        if (currentTarget == target) {
                            $(".reason_txt").text($(target).text())
                            $(".bottom").remove();
                        }
                    })
                    .on('click', '.confirm', ({ currentTarget, target }) => {
                        if (currentTarget == target) {
                            console.log("确认申请")
                        }
                    })
                    .on('click', '.cancel,.bottom', ({ currentTarget, target }) => {
                        if (currentTarget == target) {
                            $(".bottom").remove();
                        }
                    })
            }
        };
        var API = {
            getList() {

            }
        };
        var Model = {
            data: [],

        };
        return frame();
    }())
    </script>
    <style type="text/css" media="screen">
    .main {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
    }

    .top {
        width: 100%;
        height: 0.2rem;
        background-color: rgba(250, 250, 252, 1);
    }

    .requestRefund {
        width: 100%;
        height: auto;
    }

    .reason {
        width: 100%;
        height: 1rem;
        padding: 0 0.2rem;
        line-height: 1rem;
        font-size: 0.28rem;
        font-family: PingFang SC;
        font-weight: 400;
        color: rgba(51, 51, 51, 1);
        position: relative;
    }

    .reason_txt {
        display: inline-block;
        width: 4.8rem;
        text-align: right;
    }

    .reason img {
        display: inline-block;
        width: 0.16rem;
        height: 0.3rem;
        position: absolute;
        top: 0.345rem;
        left: 7.1rem;
    }

    .explanation {
        width: 100%;
        height: 3.65rem;
        padding: 0.46rem 0.59rem;
        font-size: 0.28rem;
        font-family: PingFang SC;
        font-weight: 400;
        color: rgba(51, 51, 51, 1);
    }

    .confirm {
        width: 6.3rem;
        height: 0.88rem;
        text-align: center;
        line-height: 0.88rem;
        margin: 0 auto;
        background: rgba(61, 125, 255, 1);
        border-radius: 0.1rem;
        font-size: 0.32rem;
        color: rgba(255, 255, 255, 1);
    }

    .prompt {
        width: 100%;
        height: 0.24rem;
        text-align: center;
        margin-top: 0.44rem;
        line-height: 0.24rem;
        font-size: 0.24rem;
        font-family: PingFang SC;
        font-weight: 400;
        color: rgba(153, 153, 153, 1);
    }

    .bottom {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 10;
        width: 100%;
        height: 100%;
        font-size: 0.28rem;
        text-align: center;
        background-color: rgb(0, 0, 0, 0.5);
    }

    .reason_options {
        position: fixed;
        left: 0;
        bottom: 0;
        z-index: 10;
        width: 100%;
        height: 5rem;
        padding: 0 0.2rem;
        background-color: #ffffff;
    }

    .options div {
        width: 100%;
        height: 0.8rem;
        line-height: 0.8rem;
        border-bottom: 0.01rem solid #E5E5E5;
    }

    .options div:last-child {
        border: none;
    }

    .cancel {
        width: 100%;
        height: 0.8rem;
        color: #3d7de1;
        line-height: 0.8rem;
    }
    </style>
</body>

</html>